Test FAMS on 1D data
Contents
randomize data
max_uniform=100;
vect1 = rand(1000,1)*max_uniform;
vect2 = randn(100,1)*3+20;
vect3 = randn(100,1)*3+60;
data=[vect1; vect2; vect3];
run FAMS
[modes,p_modes,w_modes ] =fams(data,20,15,100,'exmpl1D','res/','-h',10);
Load data points from matlab ...done
RunFAMS with res/pilot_100_exmpl1D.txt ...
Running FAMS with K=20 L=15
Run pilot fixed bandwith...done.
Start MS iterations..........done.
Join Modes with adaptive h/2, min pt=40, jump=1
pass 1.done
pass 2..........nrel 6
0 0
1 1
2 2
3 3
4 4
5 5
done
Save convergence points ...done
Save joined convergence points ...done
Save indicies of modes ...done
FAMS done.
view results
p_modes
figure(1),clf;
subplot(2,2,1),plot(data,'*'),title('1D data (x:sample num, y:value)');
subplot(2,2,2),plot(modes,'*'),title('after fams');
[f,xi]=ksdensity(modes,'width',2);
subplot(2,2,3),plot(xi,f,'.g');
subplot(2,2,4),hist(modes,10);
p_modes =
387.0000 59.6318
367.0000 20.2818
133.0000 92.9923
124.0000 45.1230
99.0000 83.5047
90.0000 4.6766